/**
 *
 */
package org.suren.littlebird.actions.logger;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
import org.suren.littlebird.Activator;
import org.suren.littlebird.actions.Reload;

/**
 * @author suren
 * @since 2015-2-2
 */
public class SuRenLoggerReloadAction extends Action
{
	private Reload reload;

	public SuRenLoggerReloadAction(Reload loggerReload)
	{
		this.reload = loggerReload;
	}

	@Override
	public String getText()
	{
		return "Reload";
	}

	@Override
	public ImageDescriptor getImageDescriptor()
	{
		return Activator.getImageDescriptor("icons/reload.gif");
	}

	@Override
	public String getToolTipText()
	{
		return "Reload the Logger List";
	}

	@Override
	public void setImageDescriptor(ImageDescriptor newImage)
	{
		super.setImageDescriptor(newImage);
	}

	@Override
	public void run()
	{
		if(reload != null)
		{
			reload.reload(null, null);
		}
	}

}
